-- @owner: @nanyang12
-- @date: 2024/10/23
-- @testpoint:connect by 语句中查询sys_connect_by_path

--step1:建表并插入数据
drop table if exists t_connect_by_0033;
create table t_connect_by_0033(x varchar2(10),y number,z number, a text);
insert into t_connect_by_0033 values('A',1,null, ' '),('B',2,1, ' '),('C',3,1, ' '),('D',4,2,' '),('E',5,3,' ') ,('F',6,4,' '),('G',7,4,' ');
--step2:connect by 语句中查询sys_connect_by_path
select sys_connect_by_path(a, '@') from t_connect_by_0033 start with x = 'A' connect by prior y=z;
--step3:清理环境
drop table if exists t_connect_by_0033;